<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<a href="/main">Return to main page</a>
<a href="<c:url value="/j_spring_security_logout" />"> Logout</a>

<h2>Admins</h2>
<table>
    <c:forEach var="admin" items="${admins}">
        <tr>
            <td>${admin.username}</td>
            <td>${admin.role}</td>
        </tr>
    </c:forEach>
</table>
<h2>Users</h2>
<table>
    <c:forEach var="user" items="${users}">
        <tr>
            <td>${user.username}</td>
            <td>${user.role}</td>
            <td><a href="/adminactions?name=${user.username}&action=upgrade"
                   onclick="return confirm('Really upgrade ${user.username} to admin?')">Upgrade to admin</a></td>
            <td><a href="/adminactions?name=${user.username}&action=delete"
                   onclick="return confirm('Really delete ${user.username}?')">Delete</a></td>
        </tr>
    </c:forEach>
</table>

</body>
</html>
